feat(convert): consolidate into one auto-detecting converter node#67
Merged
Conversation
- COREML_CONVERT_LCM gains a ckpt_name input: any checkpoint from the checkpoints folder, with the canonical SimianLuo single file as the default auto-download entry, so workflows saved before this input existed keep the old behavior - conversion routes through the unified coreml_diffusion.convert(model_version=LCM) path; the bespoke trace/convert pipeline in lcm/converter.py and the dead UNet2DConditionModelLCM wrapper are removed - output naming via compose_out_name; existing cached LCM .mlpackages reconvert once due to the new _se attention suffix in the name - LCM-LoRA merged checkpoints (plain SD1.5 architecture, no guidance embedding) are rejected by the package with a pointer to the standard converter node + LCM scheduler - requires coreml-diffusion>=0.1.4 (generic LCM conversion fix) Verified against a local ComfyUI checkout: the default entry resolves the Hugging Face single file and cache-hits a previously converted .mlpackage exposing timestep_cond; an LCM-LoRA merge raises the explanatory ValueError.
The standard CoreMLConverter now auto-detects the model version from the checkpoint (coreml-diffusion>=0.1.5, convert(model_version=None)), so: - the model_version dropdown is gone — one node converts SD15 / SDXL / SDXL refiner / full-distill LCM, the version inferred from the UNet architecture - the dedicated "Core ML LCM Converter" node, its single-model autodownload, and coreml_suite/lcm/nodes.py are removed; the converter UX was previously inconsistent (LCM only reachable through a separate autodownload-only node, while the standard converter did not list LCM at all) lcm/utils.py (sampler-side timestep_cond patching) is unchanged — runtime LCM support still keys off the converted UNet exposing timestep_cond. diffusers is dropped from the dependencies (no longer imported directly after the LCM converter removal). The e2e workflow fixture drops its now-invalid model_version input.
The auto-detect consolidation needs convert(model_version=None) from coreml-diffusion 0.1.5. requires-python stays pinned to <3.13 to match the library (coremltools-driven); relaxing it past the library's own cap makes the dependency unresolvable for the 3.13+ range.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces the model-version dropdown and the separate LCM converter node with a
single Core ML Converter that auto-detects the model version from the
checkpoint. Requires
coreml-diffusion>=0.1.5(convert(model_version=None)+detect_model_version).Why
The converter UX was inconsistent: full-distill LCM was only reachable through a
dedicated node whose sole purpose was to autodownload one specific model
(
SimianLuo/LCM_Dreamshaper_v7), while the standard converter did not list LCMat all. Since the conversion behaviour is fully determined by the UNet
architecture, the version is redundant input — the package now infers it.
Changes
CoreMLConverterdrops themodel_versioninput. One node converts SD15 / SDXL / SDXL refiner / full-distill LCM; the
version is detected from the checkpoint (cross-attention dim + guidance
embedding). Misdetection raises a clear error naming the observed evidence.
Core ML LCM Converter, its single-model autodownload,and
coreml_suite/lcm/nodes.pyare gone.coreml_suite/lcm/utils.py(sampler-side
timestep_condpatching) is unchanged.[build-system](hatchling) and move package discoveryto
[tool.hatch.build.targets.wheel]; the old Poetry-stylepackageskeyunder
[project]made the package fail to build under modern setuptools.coreml-diffusion>=0.1.5;diffusersdropped (no longer importeddirectly after the LCM converter removal).
model_versioninput.Verification
Local ComfyUI (M2 Pro, Python 3.12):
Core ML Converterexposes nomodel_version;Core ML LCM Converteris gone (confirmed via/object_info).detect_model_versionverified on real checkpoints: LCM_Dreamshaper_v7_4k →LCM, v1-5-pruned-emaonly / dreamshaper_8 → SD15, geekyghostLCM_v10
(LCM-LoRA merge) → SD15 (correctly not LCM).
coreml-diffusion==0.1.5.Runtime input handling (
CoreMLInputs) is untouched — characterization tests unchanged.